package org.yenn.pattern.aliyun.creational.prototype;

import lombok.Getter;
import lombok.Setter;

/**
 * 步骤 1
 * 创建一个实现了 Clonable 接口的抽象类。
 */
public abstract class Shape implements Cloneable {
    @Getter@Setter
    private String id;
    @Getter
    protected String type;

    protected abstract void draw();

    public Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}